Ride-hailing has become a popular choice for people to travel due to its convenience and speed, how to efficiently dispatch the appropriate orders to deliver passengers to the destination is a research hotspot today. Many researches focus on training a single agent, which then uniformly distributies orders, without the vehicle itself being involved in the decision making. To solve the above problem, a multi-agent reinforcement learning algorithm based on shared attention, named SARL (Shared Attention Reinforcement Learning), was proposed. In the algorithm, the order dispatching problem was modeled as a Markov decision process, and multi-agent reinforcement learning was used to make each agent become a decision-maker through centralized training and decentralized execution. Meanwhile, the shared attention mechanism was added to make the agents share information and cooperate with each other. Comparison experiments with Random matching (Random), Greedy algorithm (Greedy), Individual Deep-Q-Network (IDQN) and Q-learning MIXing network (QMIX) were conducted under different map scales, different number of passengers and different number of vehicles. Experimental results show that the SARL algorithm achieves optimal time efficiency in three different scale maps (100×100, 10×10 and 500×500) for fixed and variable vehicle and passenger combinations, which verifies the generalization performance and stable performance of the SARL algorithm. The SARL algorithm can optimize the matching of vehicles and passengers, reduce the waiting time of passengers and improve the satisfaction of passengers.